CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/pages/auth/verify/[token].tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
// Password reset page
7
8
// WARNING: this can't work and isn't used – no idea what's going on here.
9
// as of 2022-07: hub/auth.ts is handing the `/auth/verify?email=...&token=...` route to the verify email addresses.
10
11
import { Layout } from "antd";
12
import RedeemVerify from "components/auth/redeem-verify-email";
13
import Footer from "components/landing/footer";
14
import Head from "components/landing/head";
15
import Header from "components/landing/header";
16
import { Customize } from "lib/customize";
17
import withCustomize from "lib/with-customize";
18
import { useRouter } from "next/router";
19
20
export default function PasswordReset({ token, customize }) {
21
const router = useRouter();
22
const { email } = router.query;
23
24
return (
25
<Customize value={customize}>
26
<Head title={"Verify Email Address"} />
27
<Layout>
28
<Header />
29
<Layout.Content style={{ backgroundColor: "white" }}>
30
<RedeemVerify token={token} email_address={`${email}`} />
31
<Footer />
32
</Layout.Content>
33
</Layout>
34
</Customize>
35
);
36
}
37
38
export async function getServerSideProps(context) {
39
const { token } = context.params;
40
return await withCustomize({
41
context,
42
props: { token },
43
});
44
}
45
46